/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package czStvDpds.input;

import org.lwjgl.input.Keyboard;

/**
 * Reprezentuje informace o vstupu z klávesnice
 *
 * @author divad
 */
public final class LWJGLKeyEvent {

    public static final int KEY_NONE = Keyboard.KEY_NONE;
    public static final int KEY_ESCAPE = Keyboard.KEY_ESCAPE;
    public static final int KEY_1 = Keyboard.KEY_1;
    public static final int KEY_2 = Keyboard.KEY_2;
    public static final int KEY_3 = Keyboard.KEY_3;
    public static final int KEY_4 = Keyboard.KEY_4;
    public static final int KEY_5 = Keyboard.KEY_5;
    public static final int KEY_6 = Keyboard.KEY_6;
    public static final int KEY_7 = Keyboard.KEY_7;
    public static final int KEY_8 = Keyboard.KEY_8;
    public static final int KEY_9 = Keyboard.KEY_9;
    public static final int KEY_0 = Keyboard.KEY_0;
    public static final int KEY_MINUS = Keyboard.KEY_MINUS;
    public static final int KEY_EQUALS = Keyboard.KEY_EQUALS;
    public static final int KEY_BACK = Keyboard.KEY_BACK;
    public static final int KEY_TAB = Keyboard.KEY_TAB;
    public static final int KEY_Q = Keyboard.KEY_Q;
    public static final int KEY_W = Keyboard.KEY_W;
    public static final int KEY_E = Keyboard.KEY_E;
    public static final int KEY_R = Keyboard.KEY_R;
    public static final int KEY_T = Keyboard.KEY_T;
    public static final int KEY_Y = Keyboard.KEY_Y;
    public static final int KEY_U = Keyboard.KEY_U;
    public static final int KEY_I = Keyboard.KEY_I;
    public static final int KEY_O = Keyboard.KEY_O;
    public static final int KEY_P = Keyboard.KEY_P;
    public static final int KEY_LBRACKET = Keyboard.KEY_LBRACKET;
    public static final int KEY_RBRACKET = Keyboard.KEY_RBRACKET;
    public static final int KEY_RETURN = Keyboard.KEY_RETURN;
    public static final int KEY_LCONTROL = Keyboard.KEY_LCONTROL;
    public static final int KEY_A = Keyboard.KEY_A;
    public static final int KEY_S = Keyboard.KEY_S;
    public static final int KEY_D = Keyboard.KEY_D;
    public static final int KEY_F = Keyboard.KEY_F;
    public static final int KEY_G = Keyboard.KEY_G;
    public static final int KEY_H = Keyboard.KEY_H;
    public static final int KEY_J = Keyboard.KEY_J;
    public static final int KEY_K = Keyboard.KEY_K;
    public static final int KEY_L = Keyboard.KEY_L;
    public static final int KEY_SEMICOLON = Keyboard.KEY_SEMICOLON;
    public static final int KEY_APOSTROPHE = Keyboard.KEY_APOSTROPHE;
    public static final int KEY_GRAVE = Keyboard.KEY_GRAVE;
    public static final int KEY_LSHIFT = Keyboard.KEY_LSHIFT;
    public static final int KEY_BACKSLASH = Keyboard.KEY_BACKSLASH;
    public static final int KEY_Z = Keyboard.KEY_Z;
    public static final int KEY_X = Keyboard.KEY_X;
    public static final int KEY_C = Keyboard.KEY_C;
    public static final int KEY_V = Keyboard.KEY_V;
    public static final int KEY_B = Keyboard.KEY_B;
    public static final int KEY_N = Keyboard.KEY_N;
    public static final int KEY_M = Keyboard.KEY_M;
    public static final int KEY_COMMA = Keyboard.KEY_COMMA;
    public static final int KEY_PERIOD = Keyboard.KEY_PERIOD;
    public static final int KEY_SLASH = Keyboard.KEY_SLASH;
    public static final int KEY_RSHIFT = Keyboard.KEY_RSHIFT;
    public static final int KEY_MULTIPLY = Keyboard.KEY_MULTIPLY;
    public static final int KEY_LMENU = Keyboard.KEY_LMENU;
    public static final int KEY_SPACE = Keyboard.KEY_SPACE;
    public static final int KEY_CAPITAL = Keyboard.KEY_CAPITAL;
    public static final int KEY_F1 = Keyboard.KEY_F1;
    public static final int KEY_F2 = Keyboard.KEY_F2;
    public static final int KEY_F3 = Keyboard.KEY_F3;
    public static final int KEY_F4 = Keyboard.KEY_F4;
    public static final int KEY_F5 = Keyboard.KEY_F5;
    public static final int KEY_F6 = Keyboard.KEY_F6;
    public static final int KEY_F7 = Keyboard.KEY_F7;
    public static final int KEY_F8 = Keyboard.KEY_F8;
    public static final int KEY_F9 = Keyboard.KEY_F9;
    public static final int KEY_F10 = Keyboard.KEY_F10;
    public static final int KEY_NUMLOCK = Keyboard.KEY_NUMLOCK;
    public static final int KEY_SCROLL = Keyboard.KEY_SCROLL;
    public static final int KEY_NUMPAD7 = Keyboard.KEY_NUMPAD7;
    public static final int KEY_NUMPAD8 = Keyboard.KEY_NUMPAD8;
    public static final int KEY_NUMPAD9 = Keyboard.KEY_NUMPAD9;
    public static final int KEY_SUBTRACT = Keyboard.KEY_SUBTRACT;
    public static final int KEY_NUMPAD4 = Keyboard.KEY_NUMPAD4;
    public static final int KEY_NUMPAD5 = Keyboard.KEY_NUMPAD5;
    public static final int KEY_NUMPAD6 = Keyboard.KEY_NUMPAD6;
    public static final int KEY_ADD = Keyboard.KEY_ADD;
    public static final int KEY_NUMPAD1 = Keyboard.KEY_NUMPAD1;
    public static final int KEY_NUMPAD2 = Keyboard.KEY_NUMPAD2;
    public static final int KEY_NUMPAD3 = Keyboard.KEY_NUMPAD3;
    public static final int KEY_NUMPAD0 = Keyboard.KEY_NUMPAD0;
    public static final int KEY_DECIMAL = Keyboard.KEY_DECIMAL;
    public static final int KEY_F11 = Keyboard.KEY_F11;
    public static final int KEY_F12 = Keyboard.KEY_F12;
    public static final int KEY_F13 = Keyboard.KEY_F13;
    public static final int KEY_F14 = Keyboard.KEY_F14;
    public static final int KEY_F15 = Keyboard.KEY_F15;
    public static final int KEY_KANA = Keyboard.KEY_KANA;
    public static final int KEY_CONVERT = Keyboard.KEY_CONVERT;
    public static final int KEY_NOCONVERT = Keyboard.KEY_NOCONVERT;
    public static final int KEY_YEN = Keyboard.KEY_YEN;
    public static final int KEY_NUMPADEQUALS = Keyboard.KEY_NUMPADEQUALS;
    public static final int KEY_CIRCUMFLEX = Keyboard.KEY_CIRCUMFLEX;
    public static final int KEY_AT = Keyboard.KEY_AT;
    public static final int KEY_COLON = Keyboard.KEY_COLON;
    public static final int KEY_UNDERLINE = Keyboard.KEY_UNDERLINE;
    public static final int KEY_KANJI = Keyboard.KEY_KANJI;
    public static final int KEY_STOP = Keyboard.KEY_STOP;
    public static final int KEY_AX = Keyboard.KEY_AX;
    public static final int KEY_UNLABELED = Keyboard.KEY_UNLABELED;
    public static final int KEY_NUMPADENTER = Keyboard.KEY_NUMPADENTER;
    public static final int KEY_RCONTROL = Keyboard.KEY_RCONTROL;
    public static final int KEY_NUMPADCOMMA = Keyboard.KEY_NUMPADCOMMA;
    public static final int KEY_DIVIDE = Keyboard.KEY_DIVIDE;
    public static final int KEY_SYSRQ = Keyboard.KEY_SYSRQ;
    public static final int KEY_RMENU = Keyboard.KEY_RMENU;
    public static final int KEY_PAUSE = Keyboard.KEY_PAUSE;
    public static final int KEY_HOME = Keyboard.KEY_HOME;
    public static final int KEY_UP = Keyboard.KEY_UP;
    public static final int KEY_PRIOR = Keyboard.KEY_PRIOR;
    public static final int KEY_LEFT = Keyboard.KEY_LEFT;
    public static final int KEY_RIGHT = Keyboard.KEY_RIGHT;
    public static final int KEY_END = Keyboard.KEY_END;
    public static final int KEY_DOWN = Keyboard.KEY_DOWN;
    public static final int KEY_NEXT = Keyboard.KEY_NEXT;
    public static final int KEY_INSERT = Keyboard.KEY_INSERT;
    public static final int KEY_DELETE = Keyboard.KEY_DELETE;
    public static final int KEY_LMETA = Keyboard.KEY_LMETA;
//    public static final int KEY_LWIN = Keyboard.KEY_LWIN;
    public static final int KEY_RMETA = Keyboard.KEY_RMETA;
//    public static final int KEY_RWIN = Keyboard.KEY_RWIN;
    public static final int KEY_APPS = Keyboard.KEY_APPS;
    public static final int KEY_POWER = Keyboard.KEY_POWER;
    public static final int KEY_SLEEP = Keyboard.KEY_SLEEP;
    private int key;
    private char charakter;
    private boolean state;
    private long nanos;

    /**
     * Vytvoří nový event klávesnice
     *
     * @param key kód klávesy
     * @param charakter znak klávesy
     * @param state stav klávesy true - zmáčknuto, false - uvolněno
     * @param nanos
     */
    public LWJGLKeyEvent(int key, char charakter, boolean state, long nanos) {
        this.key = key;
        this.charakter = charakter;
        this.state = state;
        this.nanos = nanos;
    }

    /**
     * vrátí znak klávesy
     *
     * @return
     */
    public char getCharakter() {
        return charakter;
    }

    /**
     * vrátí kód klávesy
     *
     * @return
     */
    public int getKey() {
        return key;
    }

    public long getNanos() {
        return nanos;
    }

    /**
     * vrátí stav klávesy
     *
     * @return
     */
    public boolean getState() {
        return state;
    }

    /**
     * vrátí jméno klávesy podle jejího kódu
     *
     * @param key
     * @return
     */
    public static String getKeyName(int key) {
        return Keyboard.getKeyName(key);
    }

    /**
     * vrátí kód klávesy, podle jejího jména
     *
     * @param name
     * @return
     */
    public static int getKeyIndex(String name) {
        return Keyboard.getKeyIndex(name);
    }
}
